import React, { Component } from 'react';
// 导入路由
import { BrowserRouter as Router, Route, Switch, Redirect } from "react-router-dom";
// 导入民宿管理
import HomeManage from './HomeManage/HomeManage';
import Login from "./login/Login";
import Main from "./main/Main";


class App extends Component {
  render() {
    return (
      <div>
        <Router>
          <Switch>
            {/* 默认路由匹配时,自动跳转到 home 页面 ,实现路由重定向到首页*/}
            <Redirect exact from="/" to="/login"></Redirect>
            <Route path="/login" component={Login}></Route>
            <Route path="/main" component={Main}></Route>
            <Route path='/homemanage' component={HomeManage}></Route>
          </Switch>
        </Router>
      </div>
    );
  }
}

export default App;

